package day2.线程池.demo2;

import day2.线程池.MyTask;

import java.lang.reflect.Executable;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class Test {
    public static void main(String[] args) {
        ScheduledExecutorService pool = Executors.newScheduledThreadPool(1);
//        pool.scheduleAtFixedRate(new MyTask(),1,3, TimeUnit.SECONDS);
        pool.schedule(new MyTask(),3,TimeUnit.SECONDS);

        pool.shutdown();

    }
}
